<template>
	<view style="width: 100%;">
		<uni-list>
			<view style="text-align: center;font-size:105% ;">检疫申报单</view>
			<uni-list-item :show-arrow="false" title="编号" :note="datas.code" />
			<uni-list-item :show-arrow="false" title="货主单位" :note="datas.companyName" />
			<uni-list-item :show-arrow="false" title="货主姓名" :note="datas.shipperName" />
			<uni-list-item :show-arrow="false" title="联系电话" :note="datas.shipperMobile" />
			<uni-list-item :show-arrow="false" title="水生动物种类" :note="datas.breedName" />
			<uni-list-item :show-arrow="false" title="规格及数量" :note="datas.specOrNum" />
			<uni-list-item :show-arrow="false" title="来源" :note="datas.source" />
			<uni-list-item :show-arrow="false" title="用途" :note="datas.purpose" />
			<uni-list-item :show-arrow="false" title="启运时间" :note="datas.decTimeDeparture|dateFormat" />
			<uni-list-item :show-arrow="false" title="启运地点" :note="datas.departureAddress" />
			<uni-list-item :show-arrow="false" title="到达地点" :note="datas.arrivalAddress" />
			<uni-list-item :show-arrow="false" title="申报时间" :note="datas.decTime" />
			<view style="text-align: center;font-size:105% ;margin-top: 20px;">检疫申报受理单</view>
			<uni-list-item :show-arrow="false" title="受理状态" :note="datas.accState" />
			<uni-list-item :show-arrow="false" title="派员时间" :note="datas.desigTime|dateFormat" />
			<uni-list-item :show-arrow="false" title="检疫地址" :note="datas.accAddress"/>
			<uni-list-item :show-arrow="false" title="经办人" :note="datas.accOperator" />
			<uni-list-item :show-arrow="false" title="联系电话" :note="datas.accMobeltel" />
			<uni-list-item :show-arrow="false" title="处理时间" :note="datas.accTime|dateFormat" /> 
		</uni-list>
	</view>
</template>

<script>
import uniSection from '@/components/uni-section/uni-section.vue';
import uniList from '@/components/uni-list/uni-list.vue';
import uniListItem from '@/components/uni-list-item/uni-list-item.vue';
import loginjs from '@/login.js'
import {
		mapState
	} from 'vuex'
export default {
	computed: mapState(['baseUrl']),
	components: {
		uniSection,
		uniList,
		uniListItem
	},
	data() {
		return {
			datas: {
			},
			Authorization:null
		};
	},
	methods: {
		onLoad(option) {
			this.Authorization = loginjs.getAuthorization();
			this.getList(option.id)
		},
		getList(id) {
			uni.request({
				method: "GET",
				url: this.baseUrl + 'api/quarantine/declare/' + id,
				header: {
					"Authorization": this.Authorization,
				},
				success: (res) => {
					this.datas = res.data.data
					var temp=JSON.parse(this.datas.breedName)
					this.datas.breedName=''
					temp.forEach((data,i)=>{
						if(i!=temp.length-1){
						this.datas.breedName+=data+'/'	
						}else{
							this.datas.breedName+=data
						}
					})
					if(this.datas.accState==1){
						this.datas.accState='已受理'
					}else{
						this.datas.accState='不受理'
					}
				}
			})
		}
	}
};
</script>

<style>

</style>
